export default {
    props: {},
    data() {
            // @VExportData-Start
            return {
                form: {
                    staff_id: null,
                    staff_name: null,
                    role_name: null,
                },
                vjson: {
                    layout: 'DefaultLayout',
                    items: [
                        {
                            xtype: 'form',
                            colsOfRow: 2,
                            items: [
                                {
                                    xtype: 'combogrid',
                                    fieldLabel: '拣货员',
                                    bind: {
                                        value: '{form.staff_name}',
                                    },
                                    hidden: false,
                                    disabled: false,
                                    loading: false,
                                    cls: '',
                                    placeholder: '请输入',
                                    size: 'default',
                                    readonly: false,
                                    weight: 1,
                                    allowCustomInput: false,
                                    widget: 'PointStaffSearch',
                                    param: {
                                        role_name: '{form.role_name}',
                                    },
                                    lookup: {
                                        staff_id: '{form.staff_id}',
                                        staff_name: '{form.staff_name}',
                                    },
                                },
                                {
                                    xtype: 'staticfield',
                                    fieldLabel: 'staff_id',
                                    bind: {
                                        value: '{form.staff_id}',
                                    },
                                    hidden: true,
                                    disabled: false,
                                    loading: false,
                                    cls: '',
                                    placeholder: '请输入',
                                    size: 'default',
                                    readonly: false,
                                    weight: 1,
                                    text: '',
                                    lookup: {},
                                },
                                {
                                    xtype: 'staticfield',
                                    fieldLabel: 'role_name',
                                    bind: {
                                        value: '{form.role_name}',
                                    },
                                    hidden: true,
                                    disabled: false,
                                    loading: false,
                                    cls: '',
                                    placeholder: '请输入',
                                    size: 'default',
                                    readonly: false,
                                    weight: 1,
                                    text: '',
                                    lookup: {},
                                },
                            ],
                            hidden: false,
                            disabled: false,
                            loading: false,
                            cls: '',
                            scrollable: false,
                            size: 'default',
                            gutter: '',
                            labelPosition: 'right',
                            inlineMessage: true,
                            showMessage: true,
                            labelWidth: '',
                            validateOnRuleChange: true,
                            allowShrink: true,
                            shrink: true,
                            isBorder: [
                                '0px',
                                '0px',
                                '0px',
                                '0px',
                            ],
                        },
                        {
                            xtype: 'toolbar',
                            items: [
                                {
                                    xtype: 'button',
                                    text: '确定',
                                    plain: true,
                                    type: 'success',
                                    iconCls: 'antd CheckOutlined',
                                    lookup: {},
                                    listeners: {
                                        click: '{button1_click}',
                                    },
                                },
                            ],
                            hidden: false,
                            disabled: false,
                            loading: false,
                            cls: '',
                            alignRight: true,
                            isFlat: true,
                            isBorder: [
                                '0px',
                                '0px',
                                '0px',
                                '0px',
                            ],
                        },
                    ],
                    lookup: {},
                    extendProps: [],
                    listeners: {
                        onMounted: '{onMounted}',
                    },
                },
            }
            //@VExportData-End

        },
    methods: {
        onMounted() {
            this.so_ids = this.$props._input.so_ids
            this.task_ids = this.$props._input.task_ids
            //进行解绑操作
            system.showLoading()
            system.invokeServer('/pages/outbound/manage_task/ManageTask@getRoleName',{
            }).then((res)=>{
                this.form.role_name = res.data
            }).finally(()=>{
                system.clearLoading()
            })

        },
        button1_click() {
            system.invokeServer('/pages/outbound/manage_task/ManageTask@departTask',{
                staff_id: this.form.staff_id,task_ids:this.task_ids,so_ids:this.so_ids
            }).then((res)=>{
                if(res.success){
                    this.ok()
                }
            })
        },
    },
}
